<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
</h:head>
<h:body>

<f:view>
	<h:form>
			<h:selectOneRadio value="#{proprietateBeanController.type}"
				onchange="submit()">
				<f:selectItem itemLabel="Adaugare" itemValue="add" />
				<f:selectItem itemLabel="Vizualizare" itemValue="view" />
				<f:selectItem itemLabel="Cautare" itemValue="search" />
			</h:selectOneRadio>
		</h:form>
		<br />
		<h:form>
			<h:selectOneRadio value="#{proprietateBeanController.radio}"
				layout="pageDirection" onchange="submit()">
				<f:selectItem itemLabel="Proprietate" itemValue="prop" />
				<f:selectItem itemLabel="Casa" itemValue="casa" />
				<f:selectItem itemLabel="Teren" itemValue="teren" />
			</h:selectOneRadio>
		</h:form>
		<h:form rendered="#{proprietateBeanController.view==1}">
			<h:panelGrid border="1" columns="2"
				rendered="#{proprietateBeanController.editable==1}">
				<h:outputText value="Proprietate adresa"></h:outputText>
				<h:inputText value="#{proprietateDTO.adresa}">
				</h:inputText>
			</h:panelGrid>
			<h:commandButton rendered="#{proprietateBeanController.editable==1}"
				value="Salveata"
				action="#{proprietateBeanController.inserareProprietate}"></h:commandButton>

			<h:panelGrid border="1" columns="2"
				rendered="#{proprietateBeanController.editable==2}">
				<h:outputText value="Casa adresa"></h:outputText>
				<h:inputText value="#{casaDTO.adresa}"></h:inputText>
				<h:outputText value="Casa nr.camere"></h:outputText>
				<h:inputText value="#{casaDTO.nrcamere}"></h:inputText>
				<h:outputText value="Casa pret"></h:outputText>
				<h:inputText value="#{casaDTO.pret}"></h:inputText>
				<h:outputText value="Casa suprafata"></h:outputText>
				<h:inputText value="#{casaDTO.suprafata}"></h:inputText>
			</h:panelGrid>
			<h:commandButton rendered="#{proprietateBeanController.editable==2}"
				value="Salveata" action="#{proprietateBeanController.inserareCasa}"></h:commandButton>

			<h:panelGrid border="1" columns="2"
				rendered="#{proprietateBeanController.editable==3}">
				<h:outputText value="Teren adresa"></h:outputText>
				<h:inputText value="#{terenDTO.adresa}"></h:inputText>
				<h:outputText value="Teren pret unitar"></h:outputText>
				<h:inputText value="#{terenDTO.pretunitar}"></h:inputText>
				<h:outputText value="Teren suprafata"></h:outputText>
				<h:inputText value="#{terenDTO.suprafata}"></h:inputText>
			</h:panelGrid>
			<h:commandButton rendered="#{proprietateBeanController.editable==3}"
				value="Salveata" action="#{proprietateBeanController.inserareTeren}"></h:commandButton>
		</h:form>


		<h:form rendered="#{proprietateBeanController.view==2}">

			<h:dataTable border="1"
				value="#{proprietateBeanController.propList }" var="u"
				rendered="#{proprietateBeanController.editable==1 }">



				<h:column>
					<f:facet name="header">
						<h:commandLink
							action="#{proprietateBeanController.propSortAdress}">
							<h:outputText value="Adresa"></h:outputText>
						</h:commandLink>
					</f:facet>


					<h:outputText style="" value="#{u.adresa}"></h:outputText>

				</h:column>
			</h:dataTable>

			<h:dataTable border="1"
				value="#{proprietateBeanController.caseList }" var="v"
				rendered="#{proprietateBeanController.editable==2 }">
				<h:column>
					<f:facet name="header">
						<h:commandLink
							action="#{proprietateBeanController.casaSortAdress}">
							<h:outputText value="Adresa"></h:outputText>
						</h:commandLink>
					</f:facet>

					<h:outputText style="" value="#{v.adresa}"></h:outputText>

				</h:column>

				<h:column>
					<f:facet name="header">
						<h:commandLink
							action="#{proprietateBeanController.casaSortNrCamere}">
							<h:outputText value="Nr camere"></h:outputText>
						</h:commandLink>
					</f:facet>

					<h:outputText style="" value="#{v.nrcamere}"></h:outputText>

				</h:column>
				<h:column>
					<f:facet name="header">
						<h:commandLink action="#{proprietateBeanController.casaSortPret}">
							<h:outputText value="Pret"></h:outputText>
						</h:commandLink>
					</f:facet>

					<h:outputText style="" value="#{v.pret}"></h:outputText>

				</h:column>
				<h:column>
					<f:facet name="header">
					<h:commandLink
						action="#{proprietateBeanController.casaSortSuprafata}">
						<h:outputText value="Suprafata"></h:outputText>
						</h:commandLink>
					</f:facet>
					
						<h:outputText style="" value="#{v.suprafata}"></h:outputText>
					
				</h:column>
			</h:dataTable>

			<h:dataTable border="1"
				value="#{proprietateBeanController.terenList }" var="w"
				rendered="#{proprietateBeanController.editable==3 }">
				<h:column>
					<f:facet name="header">
						<h:commandLink
						action="#{proprietateBeanController.terenSortAdress}">
						</h:commandLink>
					
						<h:outputText value="Adresa"></h:outputText>
					</f:facet>
										<h:outputText style="" value="#{w.adresa}"></h:outputText>
					
				</h:column>

				<h:column>
					<f:facet name="header">
					<h:commandLink
						action="#{proprietateBeanController.terenSortPretUnitar}">
						<h:outputText value="Pret unitar"></h:outputText>
						</h:commandLink>
					</f:facet>
						<h:outputText style="" value="#{w.pretunitar}"></h:outputText>
					
				</h:column>
				<h:column>
					<f:facet name="header">
					<h:commandLink
						action="#{proprietateBeanController.terenSortSuprafata}">
						<h:outputText value="Suprafata"></h:outputText>
						</h:commandLink>
					</f:facet>
					
						<h:outputText style="" value="#{w.suprafata}"></h:outputText>
					
				</h:column>
			</h:dataTable>
		</h:form>
</f:view>
</h:body>

</html>